QuickTime Developer Series


Sample Chapter

Plug-in Helper

Plug-in Helper is a tool that enhances QuickTime movies for the Internet. You can use Plug-in Helper to copy-protect movies or add clickable URLs to video tracks, but its main purpose is to put plug-in parameters, such as AUTOPLAY and CONTROLLER , inside a movie. When the QuickTime Plug-in plays that movie, it's just as if you had put the parameters in an <EMBED> statement.

That's nice, because you can put only one set of parameters in an <EMBED> statement, but with HREF and QTNEXT you can specify more than one movie. With Plug-in Helper, each movie can have its own set of plug-in parameters, so you can set CONTROLLER="False" in a poster movie, for example, and CONTROLLER="True" in the movie it links to.

It's also nice to move some settings out of the highly visible HTML and put them inside the movie structure for privacy. For example, you can put QTNEXT1="../Secret/Next.mov" inside a movie without ever putting the URL of Next.mov in your HTML.

Bear in mind that you can use Plug-in Helper to set the <EMBED> parameters that the QuickTime Plug-in understands, but not the parameters that the browser itself understands. So you can set QTSRC , CONTROLLER , and BGCOLOR , for example, but not SRC , HIDDEN , HEIGHT , or WIDTH .

There are two versions of Plug-in Helper, one for the Mac OS and one for Windows. Use the version that's right for you. They're both in the Tools folder on the CD.

You can open a movie in Plug-in Helper by choosing Open from the File menu, or you can drag the movie onto Plug-in Helper. There's a checkbox for copy-protecting the movie, a text-entry box for plug-in settings, and a pair of text-entry boxes for HREF links. It's pretty easy to use.

When you're ready to save your changes, click the Export button. You have to give the movie a new name or a new location at this point. If you try to overwrite the movie you just opened, it doesn't work (Plug-in Helper just beeps).

The checkbox for copy-protection and the HREF text boxes apply to a movie whether it's played by the plug-in, QuickTime Player, or any other QuickTime application.

The parameters you enter in the Plugin Settings text box affect only the QuickTime Plug-in; they won't affect a movie when it's played by QuickTime Player. The only exceptions are MOVIENAME and MOVIEID , which QuickTime Player also recognizes. If you need to store <EMBED> parameters in a movie that's targeted to QuickTime Player, see Settings You Can Save .

Making a Poster Movie

Here's a practical example. Suppose you want to embed a still image in your Web page that loads and plays a movie when someone clicks the image. Suppose further that you want the movie to load and play right where the image is. You can do this, but you need Plug-in Helper to get it right. Here's how:

  1. Make a QuickTime movie that contains just the still image. Let's call it Poster.mov . You can do this by opening an image in QuickTime Player and saving it as a self-contained movie.
  2. Embed the poster movie in your Web page and set the HREF and TARGET parameters so the real movie loads when someone clicks the image:
    <EMBED SRC="Poster.mov" HEIGHT=176 WIDTH=120
    HREF="Other.mov" TARGET="myself">

The problem now is that you don't want the poster movie to have a controller; you want people to click it, not try to play it. But you do want the second movie to have a controller, and you want it to autoplay. So:

  1. Pass the CONTROLLER="False" parameter in the <EMBED> tag for the poster movie:
    <EMBED SRC="Poster.mov" HEIGHT=176 WIDTH=120
    HREF="Other.mov" TARGET="myself" CONTROLLER="False">
  • Use Plug-in Helper to put the CONTROLLER="True" and AUTOPLAY="True" parameters inside the other movie, as shown in the following illustration:
     



    The resulting Web page has a poster movie with no controller, linked to a movie that plays automatically and has a controller. You can see an example by using your browser to open Poster.htm in the SpecialDelivery folder of the CD.

     



    You can't set a separate height or width for the two movies using Plug-in Helper; the HEIGHT and WIDTH settings specify how much space the browser provides to the plug-in, and the plug-in itself can't change them. So you have to choose one setting that works for both the poster and the movie.
  • Remember that the controller adds 16 pixels to the height of the movie, so set HEIGHT equal to at least the movie height plus 16. Ideally, the poster image should be exactly 16 pixels taller than the movie. If the poster is larger or smaller than the movie plus the controller, set HEIGHT and WIDTH to the larger dimensions and set an appropriate background color using the BGCOLOR parameter in the <EMBED> tag. Black is an effective background color for most movies.

    If you want the second movie to load in the QuickTime Player application instead of replacing the image in the Web page, set the TARGET parameter to quicktimeplayer instead of myself .

    Copy-Protecting Movies with Plug-In Helper

    There are several things you can do to copy-protect your movies using Plug-in Helper. You can set a movie characteristic that prevents the movie from being edited or saved by any QuickTime application, you can conceal a movie's URL by embedding it inside a poster movie, or you can conceal a movie's URL by embedding it in a decoy movie. You can combine these methods by copy-protecting the poster or decoy movie as well.

    A Word to the Wise

    There's a lot of interest in securing movies and, yes, there are a lot of useful tricks, but, no, there is no 100% foolproof method--someone can always point a movie camera at the screen.

    Sometimes the best answer is jujitsu; instead of fighting the force, redirect it to your benefit. Add your logo to the movie and include a live link back to your website. QuickTime makes it easy to do both. Every copy becomes free advertising. If every copy of your rock video is a clickable link to buy the CD. . .

    People love to copy things. Use viral marketing to make this force of nature your friend.

    Ahem, that said. . .

    Copy Protection

    Clicking the "Disallow saving from plugin" checkbox in Plug-in Helper is similar to setting KIOSKMODE="True" in the <EMBED> tag, but it's more secure.

    For example, if someone looks at your HTML source and sees:
    <EMBED SRC="DontCopyMy.mov" KIOSKMODE="True">
    it's no trouble for them to write their own Web page that says:
    <EMBED SRC="http://yourserver/DontCopyMy.mov" KIOSKMODE="False">
    They can then use the plug-in to copy your movie from their Web page.

    But the QuickTime Plug-in won't copy a movie if the Disallow Saving checkbox is set with Plug-in Helper, no matter what Web page it's embedded in. In fact, all QuickTime applications, including QuickTime Player and Plug-in Helper, recognize this setting, and will not copy or save the movie once it is set.

    IMPORTANT
    Make a backup copy of your movie before you turn copy-protection on using Plug-in Helper. You cannot edit and save the movie afterward.

    Concealing the URL with a Poster Movie

    You can get additional protection by using Plug-in Helper to conceal a movie's URL from viewers. Your HTML source can be simply :
    <EMBED SRC="Poster.mov" HEIGHT=176 WIDTH=120>
    The poster movie links to the real movie with an HREF parameter set by Plug-in Helper. The real movie's URL doesn't appear in your HTML.

    Tip: To prevent a copy of your movie from appearing in the browser's cache, include the QTSRCDONTUSEBROWSER="True" parameter along with the HREF parameter.

    If the poster movie is also copy-protected, it's difficult for people to find out the name or location of your real movie. Again, it won't stop a truly determined thief, but it puts a barbed wire fence behind the "No Trespassing" sign. The illustration on the next page shows how to use Plug-in Helper to embed a URL in a copy-protected poster movie.

    The poster movie in the illustration is copy-protected and displays without a controller, because the "Disallow saving from plugin" checkbox is selected and the Plugin Settings include CONTROLLER="False".





    When the viewer clicks the poster movie, it is replaced by the actual movie because Movie URL is set to Actual.mov and the Plugin Settings include TARGET="myself" . The actual movie should have a controller by default, but you can add CONTROLLER="True" to the actual movie, using Plug-in Helper, to be sure.

    IMPORTANT
    If you enter a relative URL with Plug-in Helper, it must be relative to the movie, not relative to the HTML page that holds the movie. If the movie and the Web page are in different folders, this distinction is crucial.

    Use Plug-in Helper to copy-protect the actual movie as well.

    Concealing the URL with a Decoy Movie

    You can use Plug-in Helper to automatically link one movie to another using the QTNEXT parameter. Putting the QTNEXT parameter inside the first movie, instead of putting it in the <EMBED> tag, conceals the URL of the second movie without requiring the user to click a poster.

    Instead of a poster movie, create a very short movie, such as a single black frame with a duration of 1/10 second. Let's call this a decoy movie. Use Plug-in Helper to copy-protect the decoy movie, set AUTOPLAY="True" , and set QTNEXT1 to the actual movie with T<myself> . This makes the decoy movie play automatically, then replace itself with another movie whose URL does not appear in your HTML.





    Tip: If you set CONTROLLER="False" in a decoy movie, you need to use Plug-in Helper to set CONTROLLER="True" in the actual movie. That's because a poster movie uses HREF , which resets the default controller, while a decoy movie uses QTNEXT , which doesn't reset the controller.

    As an alternative to using QTNEXT in a decoy movie, you can use HREF combined with the AUTOHREF parameter. So
    QTNEXT1="<Actual.mov> T<myself>"
    becomes
    HREF="Actual.mov" TARGET="myself" AUTOHREF="True"

    If you use QTNEXT , the decoy movie plays before the next movie loads. If you use HREF and AUTOHREF , the next movie loads immediately. The AUTOHREF parameter requires QuickTime 4.1 or later.

    Okay, enough about copy-protection. Let's look at some other things you can do with Plug-in Helper.

    Loading a URL from a Movie

    You can embed links to various URLs inside a movie using Plug-in Helper. This makes the links independent of any HTML, so multiple movies specified by a single <EMBED> tag can each have their own links.

    It also allows you to create links that work when a movie is playing in QuickTime Player. QuickTime Player can load the URL itself, without going through a browser, or it can open the URL in a browser window, launching the browser if necessary.

    The URL can specify a movie, a Web page, or some other file. It can be targeted to load in a window or frame of the browser, to replace the current movie, or to load in QuickTime Player.

    There are three areas in the Plug-in Helper window where you can add URLs: the Plugin Settings text box, the Movie URL text box, or the Track URL text box. Each has a different behavior.

    Plugin Settings Text Box

    You add a URL in the Plugin Settings box using this syntax:
    HREF="< Url > T< Target >"

    Note: An HREF command in the Plugin Settings window is only active when the movie is played by the QuickTime Plug-in. QuickTime Player ignores it (after all, it's a plug-in setting).

    The specified URL can be relative or absolute. If a relative URL is used, it must be relative to the movie, not relative to the Web page the movie is embedded in. Absolute URLs can use http:// , ftp:// , rtsp:// , or file:/// protocols.

    The T< Target > parameter is optional. If no target is specified, the URL loads in the current browser window or frame, replacing the current movie and any Web page it's embedded in.

    If a target is specified, it can be a browser window, a frame, or the special values quicktimeplayer or myself . If the window or frame specified doesn't exist, a new browser window of that name is created. If the target specified is quicktimeplayer , the URL is opened in the QuickTime Player application. If the target is myself , the URL replaces the current movie inside the plug-in.

    If you enter a URL in the Plugin Settings, the URL loads when someone clicks anywhere in the display area of the movie. This could be the display area of any video track, sprite track, or text track. It doesn't work with audio-only movies. Clicking the movie controller doesn't load the URL.

    If you also specify AUTOHREF="True" the URL loads immediately, without playing the current movie or waiting for a mouse click.

    Movie URL Text Box

    The syntax for adding a URL in the Movie URL text box is different than in the Plugin Settings text box. Enter just the URL into the Movie URL box--don't include an HREF= string. For example, enter:
    http://www.server.com/path/filename
    not
    HREF="http://www.server.com/path/filename"

    If you specify a target for the URL, you need to use angle brackets and quotes:
    "< http://www.server.com/path/filename> T<myself>"

    If you enter a URL in the Movie URL text box, the URL loads when someone clicks anywhere in the display area of the movie. This could be the display area of any video track, sprite track, or text track. It doesn't work with audio-only movies. Clicking the movie controller doesn't load the URL.

    Adding a URL in the Movie URL box creates a link that works in the QuickTime Plug-in or QuickTime Player, but the two sometimes behave differently.

    If the movie is playing in QuickTime Player, the URL must be absolute; QuickTime Player ignores relative URLs. So include a protocol identifier and the full path, such as
    HTTP://webserver.com/path/filename or
    RTSP://streamserver/path/filename

    The plug-in can handle absolute or relative URLs. Relative URLs must be relative to the movie, not relative to the HTML page that contains the movie.

    The optional T< Target > parameter affects the plug-in and QuickTime Player differently.

    • QuickTime Player
    • If no target is specified, or the target is quicktimeplayer , the URL loads in a new QuickTime Player window. The current movie continues to play.
    • If the target is myself , the URL replaces the current movie. The URL should point to a QuickTime movie, a SMIL presentation, or some other file that QuickTime can play.
    • If the target is webbrowser , the URL loads in the default browser window, launching the default browser if necessary. The current movie continues to play.
    • If some other target is specified, and the default browser has an open window or frame with that name, the URL loads there. Otherwise, a browser window with that name is created, launching the default browser if necessary. The target name is passed to the browser, so targets such as _blank or _top can have special meaning. The current movie continues to play.
    • QuickTime Plug-in
    • If no target is specified, or the target is webbrowser , the URL loads in the current browser window or frame, replacing the current movie and any Web page that contains it.
    • If the target is myself , the new URL replaces the current movie in the QuickTime Plug-in. The URL should point to a QuickTime movie or some other file that QuickTime can play.
    • If the target is quicktimeplayer , the new URL opens in QuickTime Player, launching it if necessary. If QuickTime Player is already active, the URL opens in a new player window. The movie in the plug-in continues to play.
    • If some other target is specified, and the browser has an open window or frame with that name, the URL loads there. Otherwise, a browser window with that name is created. This is useful for opening an adjunct Web page or image in another frame. The target name is passed to the browser, so targets such as _blank or _parent can have special meaning. The current movie continues to play.

    Track URL Text Box

    A track URL is similar to a movie URL, but you can enter a different track URL for every video track in the movie, whereas you can have only one movie URL. The syntax for a track URL is the same as for a movie URL. It's just that the track URL is activated when someone clicks inside the display area of a particular video track, rather than anywhere in the movie. The video tracks appear by name in a scrolling list--click one to associate a URL with it, then enter the URL.

    Since tracks can be arranged in time and space, this lets you activate a different URL depending on where or when the user clicks. Track URLs work only with video tracks, not with sprite or text tracks.

    The QuickTime Plug-in and QuickTime Player respond to track URLs just as they do to a movie URL.

    Remember: QuickTime Player ignores relative URLs, but they work in the QuickTime Plug-in; relative URLs must be relative to the movie, not relative to the Web page that holds the movie. The same TARGET parameter can cause different behavior by the QuickTime Plug-in and QuickTime Player; even the default target is different.

    You can't combine track URLs with a movie URL. Choose one or the other. If you specify both, the movie URL takes precedence and any track URLs are ignored.


    < PREVIOUS SECTION | NEXT SECTION >

    Home | Updates | Corrections | FAQ | Table of Contents |